package com.sneaker.shower.controller;

//import com.sneaker.shower.entity.dto.WxCommonReqDTO;

import com.sneaker.shower.entity.dto.WxCommonReqDTO;
import com.sneaker.shower.service.WxMaPortalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author Hechangjian
 * @version 1.0
 * @className WxPortalController
 * @date 2019/07/26 20:36
 * @description 微信验证服务器时的请求Controller
 * @program bath
 */
@RestController
@RequestMapping("/wx_ma/portal/{appId}")
@Slf4j
public class WxPortalController {

    private final WxMaPortalService wxMaPortalService;

    public WxPortalController(WxMaPortalService wxMaPortalService) {
        this.wxMaPortalService = wxMaPortalService;
    }

    @GetMapping
    public String authGet(@PathVariable("appId") String appId, WxCommonReqDTO wxCommonReqDTO) {
        log.info("当前请求：/wx_ma/portal/{}", appId);
        return wxMaPortalService.verify(wxCommonReqDTO);
    }

    @PostMapping
    public String post(@PathVariable("appId") String appId, WxCommonReqDTO wxCommonReqDTO) {
        return "success";
    }
}
